package com.example.demo.service.impl;

import com.example.demo.domain.Department;
import com.example.demo.domain.Vo.DepartmentVo;
import com.example.demo.mapper.DepartmentMapper;
import com.example.demo.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements IDepartmentService {

    @Autowired
    public DepartmentMapper departmentMapper;


    /**
     * 查询部门
     * @param department
     * @return
     */
    @Override
    public List<DepartmentVo> selectDepartment(Department department) {
        return departmentMapper.selectDepartment(department);
    }

    /**
     * 增加部门
     * @param department
     */
    @Override
    public void insertDepartment(Department department) {
        departmentMapper.insertDepartment(department);
    }

    /**
     * 修改部门
     * @param department
     */
    @Override
    public void updateDepartmentById(Department department) { departmentMapper.updateDepartmentById(department);}

    /**
     * 删除部门
     * @param departmentId
     */
    @Override
    public void delDepartmentById(long departmentId) { departmentMapper.delDepartmentById(departmentId);}
}
